import { Router, RouteRecordRaw } from 'vue-router'

import Home from '@/views/Home.vue'
import { App } from 'vue'

export const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/request',
    name: 'Request',
    component: () => import('@/views/demo/Request.vue')
  },
  {
    path: '/storeDemo',
    name: 'StoreDemo',
    component: () => import('@/views/demo/StoreDemo.vue')
  },
  {
    path: '/loadingDemo',
    name: 'LoadingDemo',
    component: () => import('@/views/demo/LoadingDemo.vue')
  },
  {
    path: '/echartDemo',
    name: 'EchartDemo',
    component: () => import('@/views/demo/EchartDemo.vue')
  },
  {
    path: '/virtualScrollDemo',
    name: 'VirtualScrollDemo',
    component: () => import('@/views/demo/VirtualScrollDemo.vue')
  },
  {
    path: '/apiDemo',
    name: 'ApiDemo',
    component: () => import('@/views/demo/ApiDemo.vue')
  }
]

export function setupRouter(app: App<Element>, router: Router) {
  app.use(router)
}
